<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>layout(布局)</title>
		
		<script type="text/javascript" src="../js/jquery-1.8.3.js" ></script>
		<script type="text/javascript" src="../js/easyui/jquery.easyui.min.js" ></script>
		<script src="../js/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script> 
		<link rel="stylesheet" href="../js/easyui/themes/default/easyui.css"> 
		<link rel="stylesheet"  href="../js/easyui/themes/icon.css"> 
		<!--引入ztree样式-->
		<script type="text/javascript" src="../js/ztree/jquery.ztree.all-3.5.js" ></script>
		<link rel="stylesheet" href="../js/ztree/zTreeStyle.css" />

		// 页面加载后执行
		<script>
			// 中部菜单一
			$(function(){
			/// 1、进行ztree菜单设置
				var setting={
					data: {
						simpleData: {
							enable:true  // 支持简单数据格式
						}
					},
					callback: {
						onClick : function(event, treeId, treeNode, clickFlag){
							var content = '<div style="width:100%;height:100%;overflow:hidden;">'
								+ '<iframe src="'+ treeNode.page+ '" scrolling="auto" style="width:100%;height:100%;border:0;" ></iframe></div>';
							
							// 没有page树形菜单，不打开选项卡
							if(treeNode.page != undefined && treeNode.page != ""){
								// 如果选项卡已经打开，选中 
								if($("#mytabs").tabs('exists',treeNode.name)){
									// 选中选项卡
									$("#mytabs").tabs('select',treeNode.name);
								}else{
									// 如果没有打开，添加选项卡 
									$("#mytabs").tabs('add',{
										title:treeNode.name,
										content: content,
										closable :true
									});
								}
							}
						}
					}
				};
			/// 2、提供ztree菜单数据设置
			var zNodes =[
						// pid为 0代表没有父节点
						{id:1,pId:0,name:"父节点一"},
						{id:2,pId:0,name:"父节点二"},
						{id:3,pId:0,name:"父节点三"},
						{id:11,pId:1,name:"百度",page:"http://www.baidu.com"},
						{id:12,pId:1,name:"子节点二",page:"http://www.qq.zeno.com"},
						{id:21,pId:2,name:"子节点一"},
						{id:22,pId:2,name:"子节点二"}
			];

			// 3、生成属性菜单
			$.fn.zTree.init($("#BaseTree"), setting, zNodes);

			
			});
			
		</script>
	
	</head>
	<body class="easyui-layout">
			<div data-options="region:'north',title:'xxxx管理系统'" style="height: 100px;">北部区域</div>			
			<div data-options="region:'east'" style="width: 80px;">东部区域</div>	
			<div data-options="region:'south'" style="height: 80px;">南部区域</div>	
			
			<div data-options="region:'center',title:'中部区域'" >
				<div id="mytabs" class="easyui-tabs" data-options="fit:true"> 
					<div data-options="closable:true" title="中部标题1"></div>
					<div data-options="title:'中部选项卡二',iconCls:'icon-reload',closable:true" ></div>
					<div title="中部标题1"></div>
				</div>
			</div>
			
		<div data-options="region:'west',title:'西部区域'" style="width: 180px;">
			<!--左侧菜单栏-->
			<div class="easyui-accordion" data-options="fit:true"><!--与主菜单的高度相适应-->
				<div data-options="title:'基础菜单'">
					<ul id="BaseTree" class="ztree" ></ul>
					
					
				</div>
				
				<div data-options="title:'菜单一'">
					<a href="javascript:void(0)" id="itjgs">中部菜单一</a><br/>
					<a href="javascript:void(0)" id="itjgs2">中部菜单二</a>
				</div>
				<div data-options="title:'菜单二'">士大夫士大夫士大夫撒旦法</div>				
			</div>	
		</div>	
		
	
	</body>
</html>
